import Vue from 'vue'
import VueRouter from 'vue-router'


// 注册登录
import Login from '@/views/Login.vue'
import Register from '@/views/register'

// 个人中心
import personalIndex from '@/views/personalIndex.vue'
import personalEdit from '../views/edit.vue'
import personalAttention from '../views/attention.vue'
import PostStar from '../views/star.vue'
import MyComments from "../views/mycomments.vue"
// 其他
import Home from '../views/Home.vue'
import aaTest from "../views/Test.vue"
import Datail from '../views/detail.vue'
import MoreComment from '../views/moreComment.vue'
import InputDom from '../components/inputDom.vue'
import Search from '../views/search.vue'
import Manage from '../views/manage.vue'


Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: "/Test",
    component: aaTest
  },
  {
    path: '/Login',
    component: Login
  },
  {
    path: "/Register",
    component: Register
  },
  {
    path: "/personalIndex",
    component: personalIndex,
    // 页面被校验权限
    meta: {
      needAuth: true
    }
  },
  {
    path: "/edit",
    component: personalEdit,
    meta: {
      needAuth: true
    }
  },
  {
    path: '/attention',
    component: personalAttention,
    meta: {
      needAuth: true
    }
  },
  {
    path: "/star",
    meta: {
      needAuth: true
    },
    component: PostStar
  },
  {
    path: '/datail',
    component: Datail
  },
  {
    path: '/morecomment',
    component: MoreComment
  },
  {
    path: "/inputDom",
    meta: {
      needAuth: true
    },
    component: InputDom
  },
  {
    path: '/mycomments',
    meta: {
      needAuth: true
    },
    component: MyComments
  },
  {
    path: '/search',
    component: Search
  },

  {
    path: '/manage',
    component: Manage
  }

]

const router = new VueRouter({
  routes
})

export default router